to handle next system numPages system currPage currPage = currPage + 1 if currPage <= numPages -- stay on this page i = pageNumber of this page i = i + 1 go to page i of this book else currPage = currPage - 1 end if end next to handle previous system numPages system currPage currPage = currPage - 1 -- request currPage if currPage >= 1 -- stay on this page i = pageNumber of this page i = i - 1 go to page i of this book else currPage = currPage + 1 end if end previous